'''
Created on 28/01/2013

@author: Milo
'''
from MaltegoTransform import *
import sys


'''Functions'''
'Adds an author which can be either Person Entity or an Organisation Entity - indicated by the type field'
def add_author(where, firstname, lastname):
    entity = where.addEntity("maltego.Person", "John Doe")
    entity.addAdditionalFields("firstname", "First Names", True, firstname)
    entity.addAdditionalFields("lastname", "Surname", True, lastname)
        
def add_organisation(where, name):
    entity = where.addEntity("danielmilofarkner.SocialNetwork.Organisation", "Science Inc.")
    entity.addAdditionalFields("organisation", "Organisation", name)
    
def add_paper(where, title, weight):
    #Note: URL ("link") is used as the unique identifier of the entity and must be unique
    entity = where.addEntity("maltego.Document", title)
    entity.addAdditionalFields("link", "link", True, title)
    entity.setWeight(weight)
    
def add_category(where, tag):
    where.addEntity("maltego.Phrase", tag)